def myprint1(n):
    if n < 10:
        print(n, end = " ")
    else:
        print(n%10,end = " ")
        myprint1(n//10)

def myprint2(n):     #基例
    if n < 10:
        print(n,end = ' ')
    else:           #链条
        myprint2(n // 10)
        print(n % 10, end = ' ')
        
myprint2(345678)
print()
myprint1(345678)